package parser

import (
	"gf-xb-api/cwt/filter/model"
	groupImpl "gf-xb-api/cwt/filter/parser/group/impl"

	"github.com/gogf/gf/v2/database/gdb"
)

func ToWrapper[T any](group model.FilterGroup[T], m *gdb.Model) (*gdb.WhereBuilder, error) {

	consumer, err := groupImpl.GetConsumerByQueryGroup[T](group, m)
	if err != nil {
		return nil, err
	}

	return consumer, nil
}
